<script  setup>
import { ref } from 'vue'
import { getCarouselAPI } from '@/api'
const swiper = ref([])
const getCarouselFn = async() => {
  const res = await getCarouselAPI()
  // console.log(res)
  swiper.value = res.result
}
getCarouselFn()
</script>
<template>
  <div class="home-banner">
    <!-- 轮播图 -->
    <carousel :swiper="swiper" :autoplay="true" :time="2000"/>
    <!-- <p style="text-align: center;">我是轮播图</p> -->
  </div>
</template>

<style scoped lang="less">
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
  background-color: #ccc;
}
:deep(.carousel-btn.prev) {
  left: 270px!important;
}
:deep(.carousel-indicator) {
  padding-left: 250px;
}
</style>
